package tracker;

/****************************************************************************************************************************
* TrackerIsotrakII describes the default configuration we use for the Polhemus Fastrak tracking Device						*
*																															*
* Written by Ross Smith - Jan 2005																							*
*																															*
****************************************************************************************************************************/

public class TrackerIsotrakII extends TrackerPolhemus{
	
	private String name = "IsotrakII";
	private int numSensors = 2;
	private int messageLength = 47;		/*Each record from the tracker is 47 bytes long*/
	private int maxUpdateHz = 60;
	
	public TrackerIsotrakII(){
	}
	
	/*Returns the name of the tracker*/
	public String getTrackerType(){
		return this.name;
	}
	
	/*The number of sensors attached to the tracker*/
	public int getNumSensors(){
		return this.numSensors;
	}
	
	/*The message length in bytes for each record of each sensor*/
	public int getMessageLength(){
		return this.messageLength;
	}
	
	/*Initilisation string used to set up the tracker configuration*/
	public String getInitilisationString(){
		/*All these values are case sensative*/
		String setOutputFormat = "O";
		String CR = "\r";
		String setHemisphere = "H";
		String setContiniousMode = "C";
		
		String init = new String("");
		
		/*Set the output format*/
		init = init.concat(setOutputFormat + "4,2,1" + CR);
		
		/*Set the hemisphere for sensor one*/
		init = init.concat(setHemisphere + "1,0,0,-1" + CR);
		
		/*Set the hemisphere for sensor two*/
		init = init.concat(setHemisphere + "2,0,0,-1" + CR);
		
		/*Turn data streaming on*/
		init = init.concat(setContiniousMode);
//Fix Me		
		//return init;
		return "O4,2,1\rH1,0,0,-1\rH2,0,0,-1\rC";
	}
	
	/*Position offset*/
	public int getPositionOffset() {
        return 3;
    }
  
	/*Rotation offset*/
	public int getRotationOffset() {
      	return 24;
    }
	
	/*Maximum update speed, should be divided by the number of sensors attached to get FPS*/
	public int getMaxUpdateSpeedInHz(){
		return this.maxUpdateHz;
	}
	
	public String getFirmwareIdent(){
		return "S208";
	}
      
}
